import mitt, { Emitter } from 'mitt'
import eventBus from '@/utils/emits'

export const gpsbus = mitt() as Emitter<any>
export const rtcbus = mitt() as Emitter<any>

export const trackBus = mitt() as Emitter<any>
export const playbackBus = mitt() as Emitter<any>


// how to use it
// import { onMounted, onUnmounted } from 'vue'
// import eventBus from '@/path/to/eventBus'

// export default {
//   setup() {
//     onMounted(() => {
//       eventBus.on('foo', arg => {
//         console.log(arg);
//       })
//     })

//     onUnmounted(() => {
//       eventBus.off('foo');
//     })
//   },
// }
